home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98b.txt
/
000125_icon-group-sender _Wed Jul 8 14:02:10 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id OAA02671
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Wed, 8 Jul 1998 14:02:09 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA10436; Wed, 8 Jul 1998 14:01:56 -0700
Date: Tue, 7 Jul 1998 21:42:48 -0500 (CDT)
From: Chris Tenaglia <cdt@post.its.mcw.edu>
To: David Starner <dstarner98@aasaa.ofe.org>
Cc: icon-group@optima.CS.Arizona.EDU
Subject: Re: Stripping excessive spaces
In-Reply-To: <35A2750A.E12A0673@aasaa.ofe.org>
Message-Id: <Pine.SOL.3.96.980707214057.20216A-100000@post.its.mcw.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 1117
try
new := reverse(trim(reverse(trim(str))))
Chris Tenaglia (system manager) | The future foretold,
Medical College of Wisconsin | The past explained,
8701 W. Watertown Plank Rd. | The present largely appologized for.
Milwaukee, WI 53226 (414)456-8765 | Organon to the Doctor
On Tue, 7 Jul 1998, David Starner wrote:
> Date: Tue, 07 Jul 1998 13:20:42 -0600
> From: David Starner <dstarner98@aasaa.ofe.org>
> To: icon-group@optima.CS.Arizona.EDU
> Subject: Stripping excessive spaces
>
> I've just started programming in Icon, and I came across the problem of
> removing all the starting and ending spaces from a string. This was my
> solution, but I think it's terribly inefficent. Can some one help me
> with a better way to do this?
>
> procedure clip(s1)
> if type(s1) == "null" then fail
> s1 ?:= {
> tab(many(' ')) & tab(0)
> }
> s1 := reverse(s1)
> s1 ?:= {
> tab(many(' ')) & tab(0)
> }
> s1 := reverse(s1)
> return s1
> end
> --
> David Starner - dvdeug@hotmail.com, dstarner98@aasaa.ofe.org
> GURPS: http://www.geocities.com/TimesSquare/Ring/7895/
>